// AWTFlowLayout.h: interface for the AWTFlowLayout class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTFLOWLAYOUT_H__14341222_3D94_11D2_A3EF_006097A44215__INCLUDED_)
#define AFX_AWTFLOWLAYOUT_H__14341222_3D94_11D2_A3EF_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "stdafx.h"
#include "AWTLayoutManager.h"

class AFX_EXT_CLASS AWTFlowLayout : public AWTLayout,
											public AWTLayoutManager
{									
DECLARE_DYNAMIC(AWTFlowLayout)
public:
	AWTFlowLayout();
	AWTFlowLayout(int align);
	AWTFlowLayout(int align, int hgap, int vgap);
	virtual ~AWTFlowLayout();

	void setAlignment(int al)
		{m_align = al;}
	int getAlignment()
		{return m_align;}
	void setHgap(int g)
		{m_hgap = g;}
	int getHgap()
		{return m_hgap;}
	void setVgap(int g)
		{m_vgap = g;}
	int getVgap()
		{return m_vgap;}
	void moveComponents(AWTContainer* target, int x, int y, int width, int height, int rowStart, int rowEnd);
	
	virtual AWTLayoutManager* getLayoutManager()
		{return static_cast<AWTLayoutManager*>(this);}
	
	//interface AWTLayoutManager
	void addLayoutComponent(CString* name, AWTComponent* comp);
	void addLayoutComponent(AWTComponent* comp, AWTObject* constraints){};
	void removeLayoutComponent(AWTComponent* comp);
	CSize preferredLayoutSize(AWTContainer* target);
	CSize minimumLayoutSize(AWTContainer* target);
	void layoutContainer(AWTContainer* target);
	void destroy()
		{delete this;}
	
	enum {LEFT, CENTER, RIGHT};

private:
	void construct(int align, int hgap, int vgap)
	{
		m_align = align;
		m_hgap = hgap;
		m_vgap = vgap;
	}

protected:
	int m_align;
	int m_hgap;
	int m_vgap;
};

#endif // !defined(AFX_AWTFLOWLAYOUT_H__14341222_3D94_11D2_A3EF_006097A44215__INCLUDED_)
